<template>
  <div class="agents-page">
    <!-- 页面标题 -->
    <div class="page-header">
      <h1 class="title">智能体广场</h1>
      <p class="subtitle">实用智能助手，提升工作效率</p>
    </div>

    <!-- 智能体列表 -->
    <a-row :gutter="[24, 24]" class="agent-list">
      <a-col
        v-for="agent in agents"
        :key="agent.id"
        :xs="{ span: 24 }"
        :sm="{ span: 12 }"
        :md="{ span: 8 }"
        :lg="{ span: 6 }"
        :xl="{ span: 6 }"
      >
        <AgentCard :agent="agent" @view="handleView" />
      </a-col>
    </a-row>

    <!-- 空状态提示（可选） -->
    <a-empty v-if="agents.length === 0" class="empty-state" />
  </div>
</template>

<script setup>
import { ref } from 'vue'
import {
  CodeOutlined,
  BugOutlined,
  SyncOutlined,
  TranslationOutlined,
  ApiOutlined,
  DatabaseOutlined,
  FileSearchOutlined,
  CustomerServiceOutlined
} from '@ant-design/icons-vue'
import router from '@/router'
import AgentCard from '@/views/component/AgentCard.vue'

const agents = ref([
  {
    id: '1',
    name: '智能代码生成器',
    icon: CodeOutlined,
    path: 'code-generator',
    description: '智能生成 Java 增删改查代码，支持灵活自定义模板。',
    color: '#52c41a'
  },
  {
    id: '2',
    name: '翻译专家',
    icon: TranslationOutlined,
    path: 'translation',
    description: '基于 AI 的智能翻译服务，支持术语表自定义。',
    color: '#1890ff'
  },
  {
    id: '3',
    name: '智能格式转换器',
    path: 'conversion',
    icon: SyncOutlined,
    description: '支持 SQL、JSON、YAML、Properties 等格式智能互转。',
    color: '#faad14'
  },
  {
    id: '4',
    name: '注释生成器',
    path: 'comment-generator',
    icon: BugOutlined,
    description: '一键为代码添加规范注释，支持粘贴或导入文件。',
    color: '#eb2f96'
  }
])

/*,
  {
    id: '5',
    name: '面试模拟器',
    icon: CustomerServiceOutlined,
    path: 'interview-simulator',
    description: 'AI智能模拟技术面试，分析回答质量，及时查漏补缺。',
    color: '#fa541c'
  },
  {
    id: '8',
    name: '论文优化专家',
    icon: FileSearchOutlined,
    path: 'paper-optimizer',
    description: '分析论文内容，提供优化建议，支持上传 Word、Pdf 文档。',
    color: '#f5222d'
  },
  {
    id: '6',
    name: '程序命名大师',
    icon: ApiOutlined,
    path: 'name-generator',
    description: '根据中文描述生成符合命名规范的文件、函数、变量名称。',
    color: '#722ed1'
  },
  {
    id: '7',
    name: '数据库设计助手',
    icon: DatabaseOutlined,
    path: 'db-design-assistant',
    description: '输入业务需求，智能生成数据库表结构、字段建议。',
    color: '#13c2c2'
  } 
 */

const handleView = (path) => {
  router.push('/agent/' + path)
}
</script>

<style scoped>
.agents-page {
  height: 100vh;
  overflow-y: auto;
  padding: 32px 24px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  background-attachment: fixed;
  font-family:
    'Segoe UI',
    system-ui,
    -apple-system,
    sans-serif;
}

.page-header {
  text-align: center;
  margin-bottom: 32px;
}

.title {
  font-size: 2rem;
  font-weight: 600;
  color: #1f1f1f;
  margin: 0 0 8px 0;
}

.subtitle {
  font-size: 1rem;
  color: #666;
  margin: 0;
}

.agent-list {
  margin-top: 16px;
}

.empty-state {
  margin-top: 64px;
  color: #999;
}

/* 响应式优化 */
@media (max-width: 768px) {
  .agents-page {
    padding: 20px 16px;
  }
  .title {
    font-size: 1.75rem;
  }
  .subtitle {
    font-size: 0.95rem;
  }
}
</style>
